package com.liu.student.service;

import com.liu.student.entity.Enrollment;

import java.util.List;

public interface EnrollmentService {
    List<Enrollment> findAll();
    List<Enrollment> findByStudentId(Long studentId);
    List<Enrollment> findByCourseId(Long courseId);
    Enrollment findById(Long id);
    void save(Enrollment enrollment);
    void update(Enrollment enrollment);
    void deleteById(Long id);
    
    // 选课和退课方法
    void enrollCourse(Long studentId, Long courseId) throws Exception;
    void dropCourse(Long studentId, Long courseId) throws Exception;
    
    // 检查是否已选课
    boolean isEnrolled(Long studentId, Long courseId);
    
    // 检查时间冲突
    boolean hasTimeConflict(Long studentId, Long courseId);
}